-
Notifications
You must be signed in to change notification settings - Fork 35
Combine startup files to one file in root directory. This fixes a bug… #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… when starting in octave.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent–this certainly improves usability of the package. Just a couple of suggestions since we're in this area anyway.
% Add modules as root directories | ||
dirs = {'autodiff', 'model-io', 'multiscale', 'modules', 'solvers', ... | ||
'visualization','co2lab'}; | ||
base_path = fileparts(mfilename('fullpath')); %#ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm reading it incorrectly, this is just rootdir()
, i.e., d
.
dirs = {'autodiff', 'model-io', 'multiscale', 'modules', 'solvers', ... | ||
'visualization','co2lab'}; | ||
base_path = fileparts(mfilename('fullpath')); %#ok | ||
clear fn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we use/assign fn
anywhere, so we could just remove this statement I think.
for i = 1:numel(dirs) | ||
mrstPath('addroot', fullfile(base_path, dirs{i})); | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the index i
here. We might as well just write this as
for rdir = dirs
mrstPath('addroot', fullfile(d, rdir{1}));
end
instead.
If we wish to be very careful/future proof we might even consider writing
for rdir = reshape(dirs, 1, [])
mrstPath('addroot', fullfile(d, rdir{1}));
end
although that is getting close to going overboard.
% Automatically load selected modules for backwards compatibility. | ||
autoload = {}; | ||
load_compat_modules(autoload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The set of compatibility modules used to be the "incomp"/"mimetic" modules at some point, but by now it's been empty for a long time. I think we should use the opportunity when fusing these startup
functions into one to just remove the compatibility modules altogether.
… when starting in octave.